<template>
<div class="main">
  <a-layout>
    <a-layout-header>
      <Head />
    </a-layout-header>
    <a-layout class="main-layout">
      <a-layout-sider>
        <Menu />
      </a-layout-sider>
      <a-layout-content>
        <router-view />
      </a-layout-content>
    </a-layout>
  </a-layout>
</div>
</template>

<script >
import Head from './layout/head.vue'
import Menu from './layout/menu.vue'

import { calc } from './calc.js'
var data = {}
export default {
  components: {
    Menu, Head
  },
  mounted(){ 
    this.init(async (addr)=>{
      window.addr = addr
      window.sender = { from:addr }
      console.log(addr, window.sender)
      console.log(this.web3)
      this.calcVal()
     

    })
  },
  methods:{
    async calcVal(){
      data.singleList = await this.web3.getAllpool().call(window.sender);
      data.lpList =  await this.web3.getAllpoolLP().call(window.sender); 
      calc(data,this.web3)
    }
  }
}
</script>

<style scoped>
.main-layout {
  height: calc(100vh - 64px);
}
</style> 